package com.结构型模式.组合模式.原理;

/**
 * @author chenhs
 * @date 2020/11/8
 */
public class Leaf3 implements IComponent {
	private String name;
	public Leaf3(String name){
		this.name =name;
	}
	@Override
	public void add(IComponent o) {
	
	}
	
	@Override
	public void remove(Integer Index) {
		System.out.println("---");
	}
	
	@Override
	public IComponent getSon(Integer index) {
		return null;
	}
	
	@Override
	public void operation() {
		System.out.println(this.name+"的方法被调用");
	}
	
}